<?php $this->load->view('common/head');?>
<?php $this->load->view('common/navbar');?>
<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">请填写执行反馈的基础内容</div>
  <div class="panel-body">
		<form class="form-inline" name="add" id="add" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="post">
		  <input type="hidden" name="proId" id="proId" value="<?=$proData ? $proData['proId'] : 0?>">
		  <input type="hidden" name="year" id="year" value="<?=$year?>">
	  	  <!-- Table -->
		  <table class="table table-condensed">
		    <tbody>
		      <tr>
		        <td class="active col-md-3 text-right"><label for="proName" class="control-label">项目名称：</label></td>
		        <td><input style="width: 200px;" type="input" required class="form-control" name="proName" id="proName" placeholder="项目名称" value="<?=$proData['proName']?>"></td>
		      </tr>
		      <tr>
		        <td class="active col-md-3 text-right"><label for="timeUnit" class="control-label">所属双月：</label></td>
		        <td>
		        	<select required class="form-control" placeholder=".col-xs-4" id="timeUnit" name="timeUnit">
		        		<option value="">请选择</option>
			          </select>
		        </td>
		      </tr>
		      <tr>
		        <td class="active col-md-3 text-right"><label for="proTypeId" class="control-label">项目类型：</label></td>
		        <td>
		        	<select style="width: 100px;" required class="form-control" placeholder=".col-xs-4" id="proTypeId" name="proTypeId">
			            <option value="">请选择</option>
			        </select>
		        </td>
		      </tr>
		      <tr>
		        <td class="active col-md-3 text-right"><label for="endTime" class="control-label">截至提交时间：</label></td>
		        <td>
			        <input style="width: 200px;" required type="input" class="form-control" name="endTime" id="endTime" onfocus="WdatePicker({startDate:'%y-%M-%d 23:59:59',dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="<?=$proData['endTime'] ? date('Y-m-d H:i:s', $proData['endTime']):''?>" placeholder="截至提交时间">
		        </td>
		      </tr>
		      <tr align="center">
		      	<td colspan="2">
		      		<button type="submit" class="btn btn-sm btn-primary">下一步</button>
		      		<button type="button" onclick="history.go(-1)" class="btn btn-sm btn-primary">取消</button>
		      	</td>
		      </tr>
		    </tbody>
		  </table>
		</form>
		</div>
</div>
<script type="text/javascript">
  $(function(){
  	initValidation();
    loadYearList('year',<?=$year ? $year : 0?>);
    loadTimeUnitList('timeUnit',<?=$year ? $year : 0?>,<?=$timeUnit ? $timeUnit : 0?>);
    loadProTypeList('proTypeId', <?=$proData['proTypeId'] ? $proData['proTypeId'] : 0?>);
  });
  //初始化验证
function initValidation(){
	$('form[name="add"]').find("input,select,textarea").jqBootstrapValidation("destroy");
	$('form[name="add"]').find("input,select,textarea").not("[type=submit]").jqBootstrapValidation({
	    preventSubmit:false,
	    submitSuccess: function (form, event) {
	         event.preventDefault();
	         ajaxFormSubmit('add');
	     },
	     submitError: function (form, event, errors) {
	       event.preventDefault();
	       }
  	});
}
</script>
<?php $this->load->view('common/foot');?>